const app = getApp();
// 全局状态管理库
import store from "./index";
// 获取菜单按钮（右上角胶囊按钮）的布局位置信息
const _getMenuButtonBoundingClientRect = wx.getMenuButtonBoundingClientRect();
let _statusBarHeight = (_getMenuButtonBoundingClientRect.top-6);
let _headerHeight = (_getMenuButtonBoundingClientRect.top+_getMenuButtonBoundingClientRect.height+6);
let headerInfo = {
    height: _headerHeight, //自定义头部总高度
    contentHeight: _headerHeight-_statusBarHeight, //自定义头部内容高度
    statusBarHeight: _statusBarHeight, //状态栏的高度
}
// 设备信息
const getSystemInfoRes = wx.getSystemInfoSync();
// 是否ios设备
getSystemInfoRes.isIos = (getSystemInfoRes.system.toLowerCase()).indexOf('ios')!=-1;
// 自定义头部距离
getSystemInfoRes.popTop = getSystemInfoRes.isIos?(getSystemInfoRes.statusBarHeight+40):(getSystemInfoRes.statusBarHeight+48);
// 头部高度
getSystemInfoRes.headerInfo = headerInfo;
// 更新设备信息状态
store.setState({
    systemInfo: getSystemInfoRes, 
    menuInfo: _getMenuButtonBoundingClientRect,
});
console.log('store',store)
// 全局状态管理库
export const _store = store;